package com.one.controller;


import com.one.bo.IndicatorBo;
import com.one.bo.RoleIndicatorBo;
import com.one.dto.Result;
import com.one.entity.IndicatorInfoEntity;
import com.one.entity.RoleIndicatorEntity;
import com.one.service.IndicatorInfoService;
import com.one.service.RoleIndicatorService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 角色指标表 前端控制器
 * </p>
 *
 * @author zwj
 * @since 2021-10-10
 */
@RestController
@RequestMapping("/roleIndicator")
public class RoleIndicatorController {
    private final RoleIndicatorService roleIndicatorService;

    public RoleIndicatorController(RoleIndicatorService roleIndicatorService) {
        this.roleIndicatorService = roleIndicatorService;
    }
    @ApiOperation(value = "条件查询角色指标", notes = "条件查询角色指标")
    @PostMapping("/selectRoleIndicator")
    public Result selectRoleIndicator(@RequestBody RoleIndicatorBo roleIndicatorBo) {
        return roleIndicatorService.selectRoleIndicator(roleIndicatorBo);
    }

    @ApiOperation(value = "删除角色指标", notes = "删除角色指标")
    @PostMapping("/deleteRoleIndicator")
    public Result deleteRoleIndicator(@RequestBody RoleIndicatorBo roleIndicatorBo) {
        return roleIndicatorService.deleteRoleIndicator(roleIndicatorBo);
    }
    @ApiOperation(value = "添加角色指标", notes = "添加角色指标")
    @PostMapping("/addRoleIndicator")
    public Result addRoleIndicator(@RequestBody RoleIndicatorEntity roleIndicatorEntity) {
        return roleIndicatorService.addRoleIndicator(roleIndicatorEntity);
    }

    @ApiOperation(value = "修改角色指标", notes = "修改角色指标")
    @PostMapping("/updateRoleIndicator")
    public Result updateRoleIndicator(@RequestBody RoleIndicatorEntity roleIndicatorEntity) {
        return roleIndicatorService.updateRoleIndicator(roleIndicatorEntity);
    }
}

